Writing Printer Driver Files
After you know which messages you need to override as part of managing certain printing tasks, you need to write your printer driver in three kinds of files:
The content of each of these file types is reviewed in this section, with sample code from the ImageWriter II printer driver included. The complete contents of the ImageWriter II driver files are found in the QuickDraw GX sample code.
- You need to write a jump table in an assembly-language file so that QuickDraw GX can invoke the correct code in response to the printing messages that it sends.
- You need to write your message override functions in code files (typically, C language files).
- You need to define in Macintosh resource files the resources that contain the data for your printer driver.
Each driver must include one or more assembly-language jump tables, one or more files of code (in assembly-language, C, Pascal, or some other language) to write the functions that the driver performs, and one or more resource files. The ImageWriter II printer driver consists of the files shown in Table 3-1.
This section describes the contents of several of these files. The complete files are found in the QuickDraw GX sample code.
The ImageWriter II printer driver is divided into two portions:
You can develop your printer driver in any number of files. Some developers find it convenient to separate the Macintosh Printing Manager compatibility portion of the code from the QuickDraw GX printing message portion, while others use different criteria to decide which code goes in which file.
- The portion that provides the overrides of the QuickDraw GX printing messages is found in the files
newapp.a
,newapp.c
, andnewapp.r
.- The portion that provides the overrides of the Macintosh Printing Manager compatibility messages is found in the files
oldapp.a
,oldapp.c
, andoldapp.r
.
Subtopics
- Message Overrides and the Jump Table
- The Message Overrides
- Using the Printing-Related Collections
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help